package com.lrm.dao;

import com.lrm.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

/**
 * @Author: 王金海
 * @Description:
 * @Date: Created by Administrator on 2017/11/30.
 * @Modified By:
 */
public interface UserJPA extends JpaRepository<User,Long>,JpaSpecificationExecutor<User>{

    User findByUsernameAndPassword(String username,String password);

//    @Query("select u.username,u.email,u.nickName,u.creatrTime,u.updataTime from User AS u where u.username=?1 and u.password=?2")
    @Query("select u from User AS u where u.username=?1 and u.password=?2")
    User login(String username, String password);
}
